cmake_minimum_required(VERSION 2.8)

file(GLOB http_src "*.cpp")
					
file(GLOB http_protocol_src "http/*.cpp")

if (${UNIX_OS})
	include_directories(
		${PROJECT_SOURCE_DIR}/include
		${PROJECT_SOURCE_DIR}//extensions/include
		${by3rd_library_include}
		/usr/local/include
		/opt/local/include
		/usr/include
		)
elseif (${WIN_OS})

else()

endif()



link_directories(${PROJECT_SOURCE_DIR}/lib//${CMAKE_BUILD_TYPE}/)
link_directories(/usr/lib/x86_64-linux-gnu)

set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE})

add_library(http SHARED ${http_src} ${http_protocol_src})

set_target_properties(http PROPERTIES OUTPUT_NAME "http")

set_target_properties(http PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -std=c++11 -fpermissive -fPIC -frtti -fexceptions")

if(CMAKE_BUILD_TYPE STREQUAL Debug)
	set_target_properties(http PROPERTIES COMPILE_FLAGS "-g3")
endif()

if(CMAKE_BUILD_TYPE STREQUAL Release)
	set_target_properties(http PROPERTIES COMPILE_FLAGS "-O3")
endif()


target_link_libraries(http base)

install(TARGETS http 
	LIBRARY DESTINATION bin
	ARCHIVE DESTINATION bin)
